package com.tepth.vehiclemaintenance.mvp.work.operator;

import com.tepth.vehiclemaintenance.bean.ChooseOperator;
import com.tepth.vehiclemaintenance.net.ApiModel;
import com.tepth.vehiclemaintenance.net.observer.SimpleDisposableObserver;

import java.util.ArrayList;

/**
 * Created by TMVPHelper on 2017/05/15
 */
public class OperatorPresenter extends OperatorContract.Presenter {

    @Override
    void getAllSuggest() {
        mRxManager.add(mModel.getAllSuggest(mView.getAuthKey())
                .subscribeWith(new SimpleDisposableObserver<ApiModel<ArrayList<ChooseOperator>>>(mView) {
                    @Override
                    public void onSucceed(Object o) {
                        ArrayList<ChooseOperator> chooseOperatorList = (ArrayList<ChooseOperator>) o;
                        mView.showSuggest(chooseOperatorList);
                    }
                }));
    }
}